package com.weizhu.swufer.autoconfiguration;

import com.weizhu.swufer.constant.SwuferConstant;
import com.weizhu.swufer.core.client.ReferenceConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "swufer.rpc")
public class SwuferProperties {

    private String registryType = "zookeeper";

    private String registryAddress = "127.0.0.1:2181";

    private int port = SwuferConstant.DEFAULT_PORT;

    private int weight = SwuferConstant.DEFAULT_WEIGHT;

    private String cluster = "FailoverCluster";

    private String loadBalancer = "RandomLoadBalancer";

    private long maxWaitTime = SwuferConstant.DEFAULT_MAX_WAIT_TIME;

    private long lazyStart = 0;

    public void setLazyStart(long lazyStart) {
        this.lazyStart = lazyStart;
    }

    public long getLazyStart() {
        return lazyStart;
    }

    public void setMaxWaitTime(long maxWaitTime) {
        this.maxWaitTime = maxWaitTime;
    }

    public long getMaxWaitTime() {
        return maxWaitTime;
    }

    public String getCluster() {
        return cluster;
    }

    public void setCluster(String cluster) {
        this.cluster = cluster;
    }

    public String getLoadBalancer() {
        return loadBalancer;
    }

    public void setLoadBalancer(String loadBalancer) {
        this.loadBalancer = loadBalancer;
    }

    public String getRegistryType() {
        return registryType;
    }

    public void setRegistryType(String registryType) {
        this.registryType = registryType;
    }

    public String getRegistryAddress() {
        return registryAddress;
    }

    public void setRegistryAddress(String registryAddress) {
        this.registryAddress = registryAddress;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
